class CommentsController < ApplicationController
#  def new
#    @comment = Comment.new
#    session[:return_to] ||= request.referer
#  end
  def create
    @blog_post = BlogPost.find(params[:blog_post_id])
    @comment = @blog_post.comments.create!(params[:comment])
#    redirect_to session[:return_to]
    redirect_to user_blog_post_path(session[:user_id], params[:blog_post_id]) , :notice => "Comment created!"  
  end

  def destroy
     @comment = Comment.find(params[:id])
     @comment.destroy
     redirect_to comments_url
   end
end
